//
//  TYCyclePagerViewCell.swift
//  worldexchange
//
//  Created by xionghao on 2019/1/8.
//  Copyright © 2019 xionghao. All rights reserved.
//

import UIKit

class TYCyclePagerViewCell: UICollectionViewCell {
    lazy var label = UILabel()
    lazy var image = UIImageView()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.addTextLabel()
        self.addImage()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.addTextLabel()
    }
    
    func addImage() {
        self.image.contentMode = .scaleAspectFill
        self.addSubview(self.image)
       
    }
    
    func addTextLabel() {
        self.label.textColor = UIColor.white
        self.label.textAlignment = NSTextAlignment.center
        self.label.font = UIFont.systemFont(ofSize: 18)
        self.addSubview(self.label)
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.label.frame = self.bounds
        self.image.frame = self.bounds
    }
}
